﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProgrammerToolsKits.Comic.Modal
{
    public class ComicBook : Interface.IComicBook
    {
        static System.Security.Cryptography.HMACMD5 md5
            = new System.Security.Cryptography.HMACMD5();
        /// <summary>
        /// 获取该漫画的名称
        /// </summary>
        public string Title { get; internal set; }

        /// <summary>
        /// 获取该漫画的简介
        /// </summary>
        public string Description { get; internal set; }

        /// <summary>
        /// 获取该漫画的封面图
        /// </summary>
        public string Thrumb { get; internal set; }

        /// <summary>
        /// 获取该漫画的链接地址
        /// </summary>
        public string Source { get; internal set; }

        public string Hash => Convert.ToBase64String(
                                    md5.ComputeHash(
                                        Encoding.UTF8.GetBytes(
                                            string.Format( "{0}{1}", new object[] { Title, Source } ) ) ) );
    }
}
